/*
	This is a arma 3 function script used for ArmA 3 Afterlife Mod
	(C) ArmACN Afterlife Mod DEV Team
	www.afterlifemod.com

	Function : ExileServer_object_player_network_addExpRequest
*/

private ["_sessionID", "_package", "_gainExp", "_newPlayerExp", "_playerObject", "_playerExp"];

_sessionID = _this select 0;
_package = _this select 1;

_gainExp = _package select 0;

_playerObject = _sessionID call ExileServer_system_session_getPlayerObject;

_playerExp = _playerObject getVariable ["ExileScore", 0];
_newPlayerExp = _playerExp + _gainExp;
_playerObject setVariable ["ExileScore", _newPlayerExp];

format["setAccountScore:%1:%2", _newPlayerExp, (getPlayerUID _playerObject)] call ExileServer_system_database_query_fireAndForget;

[_sessionID, "gainEXPResponse", [_newPlayerExp]] call AfterlifeServer_system_network_send_to;
